<table class=" CityTable" cellpadding="0" cellspacing="0">

    <?php
    $i = 0;
    foreach ($orders as $order):
        $class = 'even';
        $class_head = 'headeven';
        $class_head1 = '';
        if ($i++ % 2 == 0) {
            $class_head = 'headodd';
            $class_head1 = 'head1odd';
        }
        $class = 'odd';
        if (isset($order['Cart'])) {
            ?>
            <tr class="<?php echo $class_head; ?>">
                <td colspan="2">Order Ref: <?php echo $order['Order']['id']; ?></td>
                <td colspan="2">Date: <?php echo date("m/d/Y", strtotime($order['Order']['add_date'])); ?></td>
                <td colspan="2">Buyer: <?php echo $order['User']['first_name'] . " " . $order['User']['last_name'] ?></td>
                <td colspan="3" align="left">Total Order Amount: <?php echo "$" . $order['sum_total']; ?></td>		
            </tr>	
            <tr class="head1odd">
                <td></td>
                <td>(Item #) Title</td>
                <td>Buyer ID</td>
                <td>QTY</td>
                <td>Price</td>
                <td>Total Price</td>
                <td>Sale Date</td>
                <td>Tracking#</td>
                <td>Carrier</td>
            </tr>
        <?php if ($order['products']) {
            foreach ($order['products'] as $product) { ?>
                    <tr class="<?php echo $class_head; ?>">
                        <td><img src="<?php echo Configure::read('base_url'); ?>img/thumbs/<?php echo $product['Product']['products_thumbnailImage']; ?>" width="50" /></td>
                        <td><?php echo "(" . $product['Product']['id'] . ") " . $product['Product']['products_title']; ?></td>
                        <td><?php echo $product['User']['first_name'] . " " . $product['User']['last_name'] ?></td>
                        <td><?php echo $product['Cart']['quantity']; ?></td>
                        <td><?php echo "$" . $product['Cart']['product_cost']; ?></td>
                        <td><?php echo "$" . (($product['Cart']['quantity'] * $product['Cart']['product_cost']) + $product['Cart']['sales_tax'] + $product['Cart']['shipping_cost']); ?></td>
                        <td><?php echo date("m-d-Y", strtotime($product['Cart']['add_date'])); ?></td>
                        <td><?php echo $product['Order']['transaction_id']; ?></td>
                        <td><?php echo $product['Shipping']['shipping_method']; ?></td>
                    </tr>
            <?php }
        }
    }endforeach; ?>
</table>
<?php //echo $this->element('sql_dump'); ?> 